#include<stdio.h>
void insertsort(int* a, int n)
{
	for (int i = 0; i < n-1; i++)
	{
		int end = i;
		int temp = a[end+1];
		while (end>=0)
		{
			if (temp < a[end])
			{
				a[end+1] = a[end];
				end--;
			}
			else
			{
				break;
			}
		}
		a[end + 1] = temp;
	}
}
int main()
{	
	int a[5] = { 5,2,6,7,2 };
	insertsort(a, sizeof(a) / sizeof(int));
	for (int i = 0; i < 5; i++)
	{
		printf("%d ", a[i]);
	}
	return 0;	
}